#ifndef TIME_H
#define TIME_H

#include "stdafx.h"
#include <ctime>
#include <memory>
#include <string.h>


class DecoTimer
{
public:
	DecoTimer(void) { memset(this, 0, sizeof(DecoTimer)); }
	~DecoTimer(void) {};
	bool isStarted(void)
	{
		return (m_isStarted);
	}
	void startTimer(void);
	void resetTimer(void);
	void pauseTimer(void);
	void resumeTimer(void);
	double getCurrentTime(void);

private:
	bool   m_isPaused;
	bool m_isStarted;
#ifdef WIN32
	clock_t m_startTime;
	clock_t m_pauseTime;
	clock_t m_nowTime;
#else
	double timeDiffInSecond(timeval time1, timeval time2);
	timeval m_startTime;
	timeval m_pauseTime;
	timeval m_nowTime;
#endif
};

#endif
